// 工具函数
type PrintType = 'thinking' | 'answer' | 'system' | 'error';

const colors = {
  thinking: '\x1b[90m',
  answer: '\x1b[36m',
  system: '\x1b[32m',
  error: '\x1b[31m'
};

export function print(text: string, type: PrintType = 'system'): void {
  console.log(colors[type] + text + '\x1b[0m');
}

export function printError(text: string): void {
  print(text, 'error');
}

export function printStream(text: string, type: 'thinking' | 'answer'): void {
  process.stdout.write(colors[type] + text + '\x1b[0m');
}
